<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 <meta name="renderer" content="webkit">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>变更GPS信息</title>
<jsp:include page="../../import.jsp" flush="true" />
<style>
.moreGps{
width:398px;
-moz-border-radius:4px;
-webkit-border-radius:4px;
-ms-border-radius:4px;
-khtml-border-radius:4px;
border-radius:4px;
}
</style>
</head>
<body class="iframeBody">
 <div class="Wrapper">
           <div id="pageInTab" class="pageInTab">
                    <form id="prj_prd_veh_info_form">
                        <div class="fieldset1 tabel_col clearFix">
		                      <div class="fieldBox col_50">
				                    <div class="label">客户名称</div>
				                    <div class="field">
				                 		  <span>${vehInfo.cstNm}</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label">合同号</div>
				                    <div class="field">
				                    <span><a href="javascript:prjDetailBtn(${vehInfo.prjId});">${vehInfo.lsCntNo}</a></span>
				                    </div>
		               		 </div>
		               		<div class="fieldBox col_50">
				                    <div class="label">支付表号</div>
				                    <div class="field">
				                      <span><a href="javascript:payDetailBtn(' ' ,${vehInfo.paySchId},${vehInfo.prjPrdId },${vehInfo.prjId});">${vehInfo.paySchNo}</a></span>
				                    </div>
		               		 </div>
		               		<div class="fieldBox col_50">
				                    <div class="label">租赁物名称</div>
				                    <div class="field">
				                    <span>${vehInfo.prdNm}</span>
				                    </div>
		               		 </div>
		               		 
		               		  <div class="fieldBox col_50">
				                    <div class="label">租赁物型号</div>
				                    <div class="field">
				                     <span id="prjPrdMdl">${vehInfo.prjPrdMdl}</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_50">
				                    <div class="label">合格证型号</div>
				                    <div class="field">
				                        <%--<input name="prdMdl"  id="prdMdl"  isValid="newEngery"  type="text" class="ui-textbox"  onblur="checkPrdMdl();" value="${vehInfo.prdMdl}" validate="{required:true}" >--%>
										<span id="prdMdl">${vehInfo.prdMdl}</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label">租赁物发动机型号</div>
				                    <div class="field">
				                    <span id="prjEngMdl">${vehInfo.prjEngMdl}</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label">合格证发动机型号</div>
				                    <div class="field">
				                        <%--<input name="engMdl"  id="engMdl"  isValid="newEngery"  type="text" class="ui-textbox"  onblur="checkEngMdl();" value="${vehInfo.engMdl }" validate="{required:true}">--%>
										<span id="engMdl">${vehInfo.engMdl}</span>
									</div>
		               		 </div>
		               		   <div class="fieldBox col_50">
				                    <div class="label">发动机号</div>
				                    <div class="field">
				                        <%--<input name="engNo"  id="engNo"  isValid="newEngery"   type="text" class="ui-textbox"  value="${vehInfo.engNo }"  validate="{required:true}">--%>
										<span id="engNo">${vehInfo.engNo}</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label">合格证编号</div>
				                    <div class="field">
				                        <%--<input name="certNo"  id="certNo" type="text"  isValid="newEngery"  class="ui-textbox"  value="${vehInfo.certNo }" validate="{required:true}" >--%>
										<span id="certNo">${vehInfo.certNo}</span>
				                    </div>
		               		 </div>
		               		   <div class="fieldBox col_50">
				                    <div class="label">发证日期</div>
				                    <div class="field">
				                   		 <%--<c:if test="${detailFlag==true }">--%>
				                   		  <%--<span   id="certDtTxt" >${vehInfo.certDt}</span>--%>
				                        <%--</c:if>--%>
				                        <%--<c:if test="${detailFlag!=true }">--%>
				                        <%--<input name="certDt"  id="certDt" type="text"  class="ui-datepicker"  value="${vehInfo.certDt}" >--%>
				                        <%--</c:if>--%>
											 <span id="certDt">${vehInfo.certDt}</span>
				                    </div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label">车辆制造企业名称</div>
				                    <div class="field">
				                        <%--<input name="mfrNm"  id="mfrNm" type="text" class="ui-textbox" value="${vehInfo.mfrNm}" >--%>
										<span id="mfrNm">${vehInfo.mfrNm}</span>
									</div>
		               		 </div>
		               		   <div class="fieldBox col_50">
				                    <div class="label">车辆品牌</div>
				                    <div class="field">
				                        <%--<input name="vehBr"  id="vehBr" type="text" class="ui-textbox" value="${vehInfo.vehBr }" >--%>
										<span id="vehBr">${vehInfo.vehBr}</span>
									</div>
		               		 </div>
		               		   <div class="fieldBox col_50">
				                    <div class="label">车辆名称</div>
				                    <div class="field">
				                        <%--<input name="vehNm"  id="vehNm" type="text" class="ui-textbox" value="${vehInfo.vehNm }" >--%>
										<span id="vehNm">${vehInfo.vehNm}</span>
				                    </div>
		               		 </div>
		               		
		               		   <div class="fieldBox col_50">
				                    <div class="label">车架号</div>
				                    <div class="field">
				                        <%--<input name="vin"  id="vin" type="text"  isValid="newEngery"  class="ui-textbox" value="${vehInfo.vin}" validate="{required:true}">--%>
										<span id="vin">${vehInfo.vin}</span>
									</div>
		               		 </div>
		               		    <div class="fieldBox col_50">
				                    <div class="label">车身颜色</div>
				                    <div class="field">
				                        <%--<input name="carCl"  id="carCl" type="text" class="ui-textbox" value="${vehInfo.carCl }" >--%>
										<span id="carCl">${vehInfo.carCl}</span>
									</div>
		               		 </div>
		               		    <div class="fieldBox col_50">
				                    <div class="label"> 底盘型号</div>
				                    <div class="field">
				                        <%--<input name="chsMdl"  id="chsMdl" type="text"  class="ui-textbox" value="${vehInfo.chsMdl}" >--%>
										<span id="chsMdl">${vehInfo.chsMdl}</span>
									</div>
		               		 </div>
		               		 
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 底盘ID</div>
				                    <div class="field">
				                        <%--<input name="chsId"  id="chsId" type="text"  class="ui-textbox" value="${vehInfo.chsId}" >--%>
										<span id="chsId">${vehInfo.chsId}</span>
									</div>
		               		 </div>
		               		 
		               		<div class="fieldBox col_50">
				                    <div class="label"> 底盘合格证编号</div>
				                    <div class="field">
				                        <%--<input name="chsCertNo"  id="chsCertNo" type="text"  class="ui-textbox" value="${vehInfo.chsCertNo}" >--%>
										<span id="chsCertNo">${vehInfo.chsCertNo}</span>
									</div>
		               		 </div>
		               		 
		               		 <div class="fieldBox col_50">
				                    <div class="label">燃料种类</div>
				                    <div class="field">
				                        <%--<input name="fuelTyp"  id="fuelTyp" type="text"  class="ui-textbox" value="${vehInfo.fuelTyp}" >--%>
										<span id="fuelTyp">${vehInfo.fuelTyp}</span>
									</div>
		               		 </div>
		               		 
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 排量（ml）</div>
				                    <div class="field">
				                        <%--<input name="outVol"  id="outVol" type="text" class="ui-textbox" value="${vehInfo.outVol}" >--%>
										<span id="outVol">${vehInfo.outVol}</span>
									</div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 功率（kW）</div>
				                    <div class="field">
				                        <%--<input name="maxKw"  id="maxKw" type="text"  class="ui-textbox" value="${vehInfo.maxKw}" >--%>
										<span id="maxKw">${vehInfo.maxKw}</span>
									</div>
		               		 </div>
		               		
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 油耗</div>
				                    <div class="field">
				                        <%--<input name="oilCns"  id="oilCns" type="text"  class="ui-textbox" value="${vehInfo.oilCns}" >--%>
										<span id="oilCns">${vehInfo.oilCns}</span>
									</div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 外廓尺寸（mm）</div>
				                    <div class="field">
				                        <%--<input name="outlineSz"  id="outlineSz" type="text" class="ui-textbox" value="${vehInfo.outlineSz}" >--%>
										<span id="outlineSz">${vehInfo.outlineSz}</span>
									</div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 货厢内部尺寸（mm）</div>
				                    <div class="field">
				                        <%--<input name="cntrSz"  id="cntrSz" type="text" class="ui-textbox" value="${vehInfo.cntrSz}" >--%>
										<span id="cntrSz">${vehInfo.cntrSz}</span>
									</div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 钢板弹簧片数（片）</div>
				                    <div class="field">
				                        <%--<input name="leafSprNum"  id="leafSprNum" type="text"  class="ui-textbox" value="${vehInfo.leafSprNum}" >--%>
										<span id="leafSprNum">${vehInfo.leafSprNum}</span>
				                     </div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 轮胎数</div>
				                    <div class="field">
				                        <%--<input name="whlNum"  id="whlNum" type="text"  class="ui-textbox" value="${vehInfo.whlNum}" >--%>
										<span id="whlNum">${vehInfo.whlNum}</span>
									</div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 轮胎规格</div>
				                    <div class="field">
				                        <%--<input name="whlSpec"  id="whlSpec" type="text"  class="ui-textbox" value="${vehInfo.whlSpec}" >--%>
										<span id="whlSpec">${vehInfo.whlSpec}</span>
									</div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 轮距(前/后)（mm）</div>
				                    <div class="field">
				                        <%--<input name="thread"  id="thread" type="text"  class="ui-textbox" value="${vehInfo.thread}" >--%>
										<span id="thread">${vehInfo.thread}</span>
									</div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label">轴距（mm）</div>
				                    <div class="field">
				                        <%--<input name="whlBase"  id="whlBase" type="text"  class="ui-textbox" value="${vehInfo.whlBase}">--%>
										<span id="whlBase">${vehInfo.whlBase}</span>
									</div>
		               		 </div>
		               		 
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 轴荷（kg）</div>
				                    <div class="field">
				                        <%--<input name="axleLoad"  id="axleLoad" type="text"  class="ui-textbox" value="${vehInfo.axleLoad}">--%>
										<span id="axleLoad">${vehInfo.axleLoad}</span>
									</div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label">轴数</div>
				                    <div class="field">
				                        <%--<input name="axisNum"  id="axisNum" type="text"  class="ui-textbox" value="${vehInfo.axisNum}" >--%>
										<span id="axisNum">${vehInfo.axisNum}</span>
									</div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label">转向形式</div>
				                    <div class="field">
				                        <%--<input name="strTyp"  id="strTyp" type="text" class="ui-textbox" value="${vehInfo.strTyp}" >--%>
										<span id="strTyp">${vehInfo.strTyp}</span>
									</div>
		               		 </div>
		               		 <div class="fieldBox col_50">
				                    <div class="label"> 总质量</div>
				                    <div class="field">
				                        <%--<input name="totWgt"  id="totWgt" type="text"  class="ui-textbox" value="${vehInfo.totWgt}" >--%>
										<span id="totWgt">${vehInfo.totWgt}</span>
									</div>
		               		 </div>
		               		 
		               		  <div class="fieldBox col_50">
				                    <div class="label"> 整备质量（kg）</div>
				                    <div class="field">
				                        <%--<input name="curbWgt"  id="curbWgt" type="text"  class="ui-textbox" value="${vehInfo.curbWgt}" >--%>
										<span id="curbWgt">${vehInfo.curbWgt}</span>
									</div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label"> 额定载质量（kg）</div>
				                    <div class="field">
				                        <%--<input name="ratedWgt"  id="ratedWgt" type="text"  class="ui-textbox" value="${vehInfo.ratedWgt}" >--%>
										<span id="ratedWgt">${vehInfo.ratedWgt}</span>
									</div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label"> 载质量利用系数</div>
				                    <div class="field">
				                        <%--<input name="wgtCoe"  id="wgtCoe" type="text"  class="ui-textbox" value="${vehInfo.wgtCoe}" >--%>
										<span id="wgtCoe">${vehInfo.wgtCoe}</span>
									</div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label"> 准牵引总质量（kg）</div>
				                    <div class="field">
				                        <%--<input name="traTotWgt"  id="traTotWgt" type="text"  class="ui-textbox" value="${vehInfo.traTotWgt}" >--%>
										<span id="traTotWgt">${vehInfo.traTotWgt}</span>
									</div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label"> 半挂车鞍座最大允许总质量（kg）</div>
				                    <div class="field">
				                        <%--<input name="semiMaxWgt"  id="semiMaxWgt"  type="text"   class="ui-textbox" value="${vehInfo.semiMaxWgt}" >--%>
										<span id="semiMaxWgt">${vehInfo.semiMaxWgt}</span>
									</div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label"> 驾驶室准乘人数（人）</div>
				                    <div class="field">
				                        <%--<input name="cabSeatQty"  id="cabSeatQty" type="text"  class="ui-textbox" value="${vehInfo.cabSeatQty}">--%>
										<span id="cabSeatQty">${vehInfo.cabSeatQty}</span>
									</div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label"> 额定载客（人）</div>
				                    <div class="field">
				                        <%--<input name="ratedSeatQty"  id="ratedSeatQty" type="text"  class="ui-textbox" value="${vehInfo.ratedSeatQty}" >--%>
										<span id="ratedSeatQty">${vehInfo.ratedSeatQty}</span>
									</div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label">最高设计车速（km/h）</div>
				                    <div class="field">
				                        <%--<input name="maxSpd"  id="maxSpd" type="text"  class="ui-textbox" value="${vehInfo.maxSpd}" >--%>
										<span id="maxSpd">${vehInfo.maxSpd}</span>
									</div>
		               		 </div>
		               		  <div class="fieldBox col_50">
				                    <div class="label"> 车辆制造日期</div>
				                    <div class="field">
				                        <%--<input name="proDt"  id="proDt"  type="text"  class="ui-datepicker"  value="${vehInfo.proDt}">--%>
										<span id="proDt">${vehInfo.proDt}</span>
									</div>
		               		 </div>
		               		  <div class="fieldBox col_100">
				                    <div class="label">排放标准</div>
				                    <div class="field">
				                        <%--<input name="emiStd"  id="emiStd" type="text"  class="ui-textbox" value="${vehInfo.emiStd}" >--%>
										<span id="emiStd">${vehInfo.emiStd}</span>
									</div>
		               		 </div>
		               		<div class="fieldBox col_100">
				                    <div class="label"> 备注</div>
				                    <div class="field">
				                    	<%--<textarea name="dtlRem" id="dtlRem"    rows="4"  class="ui-textarea l-textarea" style="width:80%"  value=""  >${vehInfo.dtlRem }</textarea>--%>
										<span id="dtlRem">${vehInfo.dtlRem}</span>
									</div>
		               		 </div>
							<!--GPS卡号 -->
							<div class="fieldBox col_100">
								<div class="sqPanel_body">
									<div id="gpsInfoCfgGrid" class="sq-grid"></div>
									<div><span id="gpsInfoCfgGrid_comment"></span></div>
								</div>
							</div>

                              <div class="fieldBox col_50"  style="display: none">
                                <div class="field"> 
                              		<input name="vehId" id="vehId" type="text"  value="${vehInfo.id }" >
                              		<input name="dtlId" id="dtlId" type="text"  value="${vehInfo.dtlId }" >
                                </div>
                            </div>
                               <div class="fieldBox col_100">
				                    <div class="label">挂靠公司</div>
				                    <div class="field">
				                     <span> 
				                    	<%--<input name="lnkCompNm" id="lnkCompNm"  type="text"  class="ui-textbox"   value="${vehInfo.prjPrdDtl.lnkCompNm}"   readonly="readonly">--%>
				                     	<span id="lnkCompNm">${vehInfo.prjPrdDtl.lnkCompNm}</span>
									 </span>
				                     <%--<input name="lnkCompId" id="lnkCompId" type="hidden"  value="${vehInfo.prjPrdDtl.lnkCompId}" >--%>
				                     	<!-- <span id="chooseLnkComp" class="sq-button sq-button-hasicon" onclick="choosePrjLnkComp();"><i class="sqBtnIco_1"></i>更改</span> -->
				                    </div>
		               		 </div>
                            	  <div class="fieldset1 tabel_col tabel_col_s clearFix">
	                            <!-- <div class="caption">
	                                <span class="title">合格证扫描照片信息 </span>
	                            </div> -->
							<%--<c:if test="${detailFlag!=true }">--%>
	                          <%--<div class="fieldBox col_100">--%>
			                    <%--<div class="label">合格证上传</div>--%>
			                    <%--<div class="field">--%>
			                    	<%--<jsp:include page="../../system/sysUlFilesRec/sysSysUlFilesRecUpload2.jsp" flush="true" >--%>
			                    		<%--<jsp:param name="filePath" value="capital/capPayInfo"/>--%>
			                    	<%--</jsp:include>--%>
			                    	 <%--<input id="tabNm"  name="tabNm"  type="hidden"  value="PRJ_PRD_DTL">--%>
			                    	<%--<input  id="pkId"  name="pkId"  type="hidden"  value="${dtlId}">--%>
			                    <%--</div>--%>
			               <%--</div>--%>
			               <%--</c:if>--%>
			               
	              </div>
						</div>
                    </form>
                    </div>
                    
                              <div class="sqPanel">
		            <div class="sqPanel_head inL">
		                <span>合格证扫描照片信息</span>
		            </div>
		            <table class="table_full tbl_1">
			            <tbody id="imgTable">

			            </tbody>
		            </table>
  			 </div>
                 
                     <div class="btnsBox">
		                <span id="prj_prd_veh_info_add_btn_id" class="sq-button sq-button-round"  onclick="save();"><!-- <i class="sqBtnIco_10"></i> -->保存</span>
         				<!--  <span id="scanData" class="sq-button sq-button-round" >扫描获取数据</span> -->
           		    </div>
	</div>

<script type="text/javascript">

var gpsInfoCfgGrid = null;//GPS卡号明细
var id = '${id}';// 当前记录id
var detailFlag = '${detailFlag}'; 
var dtlId = '${dtlId}';
var imgPath = '${imgPath}';
var buOrgCd='${buOrgCd}';
var LSvin = '${LSvin}';//查询车架号历史数据
var prjTypCd = "${prjTypCd}";//项目类型
var prdStsCd = "${prdStsCd}";//资产状态
var isGpsNode = "${isGpsNode}";// 是否为风控审批GPS 节点 1：是 0：否
var handleType = "${handleType}";// 操作类型， 1-跳转到变更GPS页面
var isEdit = "${isEdit}";//0 表示不可以编辑 1表示可以编辑
var cstMgrOrgCd = '${cstMgrOrgCd}'; // 客户经理组织机构代码
var wait_dialog;

function getEditor(){
	// 专车客车事业部暂时未接入大数据平台，特殊处理
	if(StringUtils.isNotEmpty(cstMgrOrgCd) && cstMgrOrgCd.substr(0,12)=="000000080002"){
		return {type: 'text'};
	}else{
		return {
			type: 'popup', valueField: 'gpsCarNo', textField: 'gpsCarNo', width:300,
			grid:
					{
						data: gpsDevice,
						columns: [
							{ name: 'gpsCarNo', width: 200, display: 'GPS卡号' }
						],
						root:'rows',
						record:'total'
					},
			condition: {
				fields: [
					{ name: 'gpsCarNo', type: 'text', label: 'GPS卡号', width: 200 }
				]
			},
			searchClick: function (e)
			{
				//alert("这里可以根据搜索规则来搜索（下面的代码已经本地搜索),搜索规则:" + liger.toJSON(e.rules));
				e.grid.loadData($.ligerFilter.getFilterFunction(e.rules));
			}
		}
	}
}

$(function () {
    	// 说明：资产状态, 1-风控审批GPS，说明页面是修改GPS,没有放款，不需要走GPS变更流程

		console.log("操作类型handleType ：" + handleType);
		console.log("isGpsNode是否为风控审批GPS 节点 1-是, 0-否 ：" + isGpsNode);
		console.log("GPS变更页面是否可编辑，isEdit： " + isEdit);

		// 初始GPS账号下设备
		// 之前:专车客车事业部暂时未接入大数据平台，特殊处理 现在:全体事业部
		if(StringUtils.isNotEmpty(cstMgrOrgCd) && cstMgrOrgCd.substr(0,12)!="000000080002"){
			$.ajax({
				type: 'get',
				dataType:'json',
				url: '<%=path%>/prjprddtlgps/prjPrdDtlGps/getGpsDevice.do?dtlId='+dtlId,
				async:false, //同步请求，防止initGrid 时没有数据
				success:function(msg){
					if (msg.data != null) {
						gpsDevice = msg.data;
					}
				}
			});
		}

		// 加载GPS信息
		gpsInfoCfgGrid = $("#gpsInfoCfgGrid").ligerGrid({
			url: '<%=path%>/prjprddtlgps/prjPrdDtlGps/initGPSInfoList.do?prjDtlId=${dtlId}',
			method: 'get',
			columns: [
				{display: 'GPS卡号', name: 'gpsCardNo',editor:{type: 'text'}, isAllowHide:false},
				{display: 'GPS在线状态', name: 'onlineTypeNm'},
				{display: '末次位置', name: 'gpsAddrInfo'},
				{display: '经度', name: 'lng'},
				{display: '纬度', name: 'lat'},
				{display: '末次时间', name: 'lastTm'},
				{display: '距离当前时间(小时)', name: 'fromLastTm'},
				{display: '设备类型', name: 'gpsDeviceType'},
				{display: '领用人工号', name: 'receiveName'},
				{display: '领用人姓名', name: 'receiveRealName'}
			],
			onAfterEdit:function (e) {// 编辑结束后事件
				console.log("合同修改页面获取到的GPS：" + e.value)

				gpsCardNoAfterEdit(e);

				/*var reg = /^[0-9]+.?[0-9]*$/;
				var gpsCardNo = e.value;

				if (typeof gpsCardNo == "undefined" || gpsCardNo == null || gpsCardNo == "") {
					gpsInfoCfgGrid.updateCell('gpsCardNo', '0', e.record);
					gpsInfoCfgGrid.updateCell('onlineTypeNm', '', e.record);
					gpsInfoCfgGrid.updateCell('gpsAddrInfo', '', e.record);
					gpsInfoCfgGrid.updateCell('lng', '', e.record);
					gpsInfoCfgGrid.updateCell('lat', '', e.record);
					gpsInfoCfgGrid.updateCell('lastTm', '', e.record);
					gpsInfoCfgGrid.updateCell('fromLastTm', '', e.record);
					gpsInfoCfgGrid.updateCell('deviceType', '', e.record);
					gpsInfoCfgGrid.updateCell('receiveName', '', e.record);
					gpsInfoCfgGrid.updateCell('receiveRealName', '', e.record);
				} else {
					// 校验GPS卡号必须是纯数字
					if (!reg.test(gpsCardNo)) {
						$.ligerDialog.SQalert({content: "GPS卡号仅支持15位纯数字", SQ_type: "warring"});
					} else {
						// 是纯数字，校验GPS卡号的长度
						if (gpsCardNo.length > 15) {
							$.ligerDialog.SQalert({content: "GPS卡号数字长度大于15", SQ_type: "warring"});
						} else {
							// 调用大数据查询gps设备信息
							var url = '<%=path%>/project/prjprdvehinfo/validateGpsDeviceInfo.do';
							$.ajax({
								type: 'get',
								dataType:'json',
								data:{gpsCardNo: gpsCardNo,dtlId:${dtlId}},
								url: url,
								success:function(msg){
									if (msg != null) {

										// 调用大数据返回正确信息
										if (msg.success == 1) {
											if (msg.info == null || msg.info == '') {
												// 客户经理和实际领用人一致，不显示确认框,显示信息
												if (msg.data != null) {
													gpsInfoCfgGrid.updateCell('deviceType', msg.data.gpsDeviceType, e.record);
													gpsInfoCfgGrid.updateCell('receiveName', msg.data.receiveName, e.record);
													gpsInfoCfgGrid.updateCell('receiveRealName', msg.data.receiveRealName, e.record);
												} else {
													$.ligerDialog.SQalert({content: "查询GPS设备信息,调用大数据返回空", SQ_type: "warring"});
												}
											} else {
												/!* success成功的情况下,info是不为空的，
                                                 *说明客户经理和实际领用人不一致,
                                                 * 要出现确认框
                                                 *!/
												$.ligerDialog.confirm(msg.info, function (flag) {
													if(!flag) {
														gpsInfoCfgGrid.updateCell('gpsCardNo', '0', e.record);
														gpsInfoCfgGrid.updateCell('onlineTypeNm', '', e.record);
														gpsInfoCfgGrid.updateCell('gpsAddrInfo', '', e.record);
														gpsInfoCfgGrid.updateCell('lng', '', e.record);
														gpsInfoCfgGrid.updateCell('lat', '', e.record);
														gpsInfoCfgGrid.updateCell('lastTm', '', e.record);
														gpsInfoCfgGrid.updateCell('fromLastTm', '', e.record);
														gpsInfoCfgGrid.updateCell('deviceType', '', e.record);
														gpsInfoCfgGrid.updateCell('receiveName', '', e.record);
														gpsInfoCfgGrid.updateCell('receiveRealName', '', e.record);
														return;
													}

													// 点击是，也要显示信息
													if (msg.data != null) {
														gpsInfoCfgGrid.updateCell('deviceType', msg.data.gpsDeviceType, e.record);
														gpsInfoCfgGrid.updateCell('receiveName', msg.data.receiveName, e.record);
														gpsInfoCfgGrid.updateCell('receiveRealName', msg.data.receiveRealName, e.record);
													} else {
														$.ligerDialog.SQalert({content: "查询GPS设备信息,调用大数据返回空", SQ_type: "warring"});
													}
												});
											}

										} else {
											// 返回错误信息
											$.ligerDialog.SQalert({content: msg.info, SQ_type: "warring"});
										}
									} else {
										$.ligerDialog.SQalert({content: "DataResultVO为空", SQ_type: "warring"});
									}
								}
							});

							// 调用GPS位置第三方接口,把GPS信息更新到列表中
							var url = '<%=path%>/project/prjprdvehinfo/getGps.do';
							$.ajax({
								type: 'get',
								dataType:'json',
								data:{gpsNum: newStr,dtlId:${dtlId}},
								url: url,
								success:function(msg){
									if (msg.data != null){
										if(msg.data.onlineType == '0'){
											gpsInfoCfgGrid.updateCell('onlineTypeNm', '离线', e.record);
										}else if(msg.data.onlineType == '1'){
											gpsInfoCfgGrid.updateCell('onlineTypeNm', '在线', e.record);
										}else if(msg.data.onlineType == '2'){
											gpsInfoCfgGrid.updateCell('onlineTypeNm', '休眠', e.record);
										}
										gpsInfoCfgGrid.updateCell('gpsAddrInfo', msg.data.gpsAddrInfo, e.record);
										gpsInfoCfgGrid.updateCell('lng', msg.data.lng, e.record);
										gpsInfoCfgGrid.updateCell('lat', msg.data.lat, e.record);
										gpsInfoCfgGrid.updateCell('lastTm', msg.data.lastTm, e.record);
										gpsInfoCfgGrid.updateCell('fromLastTm', msg.data.fromLastTm, e.record);
									}
								}
							});
						}
					}
				}*/

				/*// 验证逻辑：GPS卡号位数，15位以内(因历史数据问题，不限制数字还是字母或者特殊符号)，若超过15位,删除15位以后的字符
				var newStr = e.value;
				if (e.value.length > 15){
					newStr = e.value.substring(0,15);
					gpsInfoCfgGrid.updateCell('gpsCardNo', newStr, e.record)
				}

				console.log("GPS卡号：" + newStr);
                if (typeof newStr == "undefined" || newStr == null || newStr == "") {
                    gpsInfoCfgGrid.updateCell('onlineTypeNm', '', e.record);
                    gpsInfoCfgGrid.updateCell('gpsAddrInfo', '', e.record);
                    gpsInfoCfgGrid.updateCell('lng', '', e.record);
                    gpsInfoCfgGrid.updateCell('lat', '', e.record);
                    gpsInfoCfgGrid.updateCell('lastTm', '', e.record);
					gpsInfoCfgGrid.updateCell('fromLastTm', '', e.record);
                } else {
                    // 调用GPS位置第三方接口,把GPS信息更新到列表中
                    var url = '<%=path%>/project/prjprdvehinfo/getGps.do';
                    $.ajax({
                        type: 'get',
                        dataType:'json',
                        data:{gpsNum: newStr,dtlId:${dtlId}},
                        url: url,
                        success:function(msg){
                            console.log("调用GPS位置第三方接口，返回的信息：" + msg);
                            if (msg.data != null){
                                if(msg.data.onlineType == '0'){
                                    gpsInfoCfgGrid.updateCell('onlineTypeNm', '离线', e.record);
                                }else if(msg.data.onlineType == '1'){
                                    gpsInfoCfgGrid.updateCell('onlineTypeNm', '在线', e.record);
                                }else if(msg.data.onlineType == '2'){
                                    gpsInfoCfgGrid.updateCell('onlineTypeNm', '休眠', e.record);
                                }
                                gpsInfoCfgGrid.updateCell('gpsAddrInfo', msg.data.gpsAddrInfo, e.record);
                                gpsInfoCfgGrid.updateCell('lng', msg.data.lng, e.record);
                                gpsInfoCfgGrid.updateCell('lat', msg.data.lat, e.record);
								gpsInfoCfgGrid.updateCell('lastTm', msg.data.lastTm, e.record);
								gpsInfoCfgGrid.updateCell('fromLastTm', msg.data.fromLastTm, e.record);
                            }
                        }
                    });
				}*/
			},
			root: 'rows',
			width: '100%',
			isScroll: false, //是否滚动
			rownumbers:true,  //显示序号
			checkbox: false, //是否显示复选框
			allowUnSelectRow:true,  //是否允许反选行
			alternatingRow: false, //奇偶行效果
			usePager: false,// 是否使用分页
			enabledEdit: true   // 是否允许编辑
		});


	 var ligerForm = liger.get("prj_prd_veh_info_form");
		$("#prj_prd_veh_info_form").ligerForm({
		    validate: true
		});
		   if (buOrgCd == "00000013") {
	           $("span[isValid='newEngery']").each(function () {
                   $("input[isValid='newEngery']").each(function () {
                       $(this).attr("validate", "");
                   });
                   $(this).hide();
               });
	       }


	setFormatDateValue();
	prjPrdVehImgList();

});


/**
 * 校验gps设备是否已使用
 */
function checkGpsIsUsed(gpsCardNo,dtlId) {
	/*true:已使用  false:未使用*/
	var isUsed = true;
	// gps设备是否使用
	var url = '<%=path%>/project/prjprddtl/checkGpsIsUsed.do';
	$.ajax({
		type: 'get',
		dataType:'json',
		data:{gpsCardNo: gpsCardNo,dtlId:dtlId},
		async:false,
		url: url,
		success:function(msg){
			if (msg != null) {
				// 调用大数据返回正确信息
				if (msg.success == 1 && msg.data != null) {
					// 0:占用 不调用大数据
					// 1:未占用 调用大数据
					if (msg.data == '1') {
						isUsed = false;
					}
				} else {
					// 返回错误信息
					$.ligerDialog.SQalert({content: "查看GPS设备信息是否占用异常", SQ_type: "warring"});
				}
			} else {
				$.ligerDialog.SQalert({content: "查看GPS设备信息是否占用异常", SQ_type: "warring"});
			}
		}
	});

	return isUsed;
}

/**
 * 适用于输入完gps卡号之后，校验的信息
 */
function gpsCardNoAfterEdit(e) {
	var reg = /^[0-9]+.?[0-9]*$/;
	var gpsCardNo = e.value;

	if (typeof gpsCardNo == "undefined" || gpsCardNo == null || gpsCardNo == "") {
		gpsInfoCfgGrid.updateCell('gpsCardNo', '0', e.record);
		gpsInfoCfgGrid.updateCell('onlineTypeNm', '', e.record);
		gpsInfoCfgGrid.updateCell('gpsAddrInfo', '', e.record);
		gpsInfoCfgGrid.updateCell('lng', '', e.record);
		gpsInfoCfgGrid.updateCell('lat', '', e.record);
		gpsInfoCfgGrid.updateCell('lastTm', '', e.record);
		gpsInfoCfgGrid.updateCell('fromLastTm', '', e.record);
		gpsInfoCfgGrid.updateCell('gpsDeviceType', '', e.record);
		gpsInfoCfgGrid.updateCell('receiveName', '', e.record);
		gpsInfoCfgGrid.updateCell('receiveRealName', '', e.record);
	} else {
		// 校验GPS卡号必须是纯数字
		if (gpsCardNo != '0') {
			if (!reg.test(gpsCardNo)) {
				top.$.ligerDialog.SQalert({content: "GPS卡号仅支持15位纯数字",SQ_type: "error"});
			} else {
				// 是纯数字，校验GPS卡号的长度
				if (gpsCardNo.length != 15) {
					top.$.ligerDialog.SQalert({content: "GPS卡号数字长度不等于15",SQ_type: "error"});
				} else {
					var isUsed = checkGpsIsUsed(gpsCardNo,dtlId);
					if (isUsed) {
						top.$.ligerDialog.SQalert({content: "该设备号已使用,请核查!",SQ_type: "error"});
					} else {
						// 调用大数据查询gps设备信息
						var url = '<%=path%>/project/prjprdvehinfo/validateGpsDeviceInfo.do';
						var dataValidate = {};
						dataValidate.prjId ='${prjId}';
						dataValidate.gpsCardNo=gpsCardNo;
						dataValidate.dtlId='${dtlId}';

						$.ajax({
							type: 'get',
							dataType:'json',
							data:dataValidate,
							url: url,
							success:function(msg){
								if (msg != null) {
									// 调用大数据返回正确信息
									if (msg.success == 1) {
										if (msg.data != null) {
											gpsInfoCfgGrid.updateCell('gpsDeviceType', msg.data.gpsDeviceType, e.record);
											gpsInfoCfgGrid.updateCell('receiveName', msg.data.receiveName, e.record);
											gpsInfoCfgGrid.updateCell('receiveRealName', msg.data.receiveRealName, e.record);

											showLocations(gpsCardNo,e);
										} else {
											top.$.ligerDialog.SQalert({content: "查询GPS设备信息,调用大数据返回空",SQ_type: "error"});
										}
									} else {
										// 返回错误信息
										top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
									}
								} else {
									top.$.ligerDialog.SQalert({content: "DataResultVO为空",SQ_type: "error"});
								}
							}
						});


					}
				}
			}
		}
	}
}

/**
 * 显示经度、维度
 */
function showLocations(gpsCardNo,e) {
		// 调用GPS位置第三方接口,把GPS信息更新到列表中
	var url = '<%=path%>/project/prjprdvehinfo/getGps.do';
	$.ajax({
		type: 'get',
		dataType:'json',
		data:{gpsNum: gpsCardNo,dtlId:${dtlId}},
		url: url,
		success:function(msg){
			if (msg.data != null){
				if(msg.data.onlineType == '0'){
					gpsInfoCfgGrid.updateCell('onlineTypeNm', '离线', e.record);
				}else if(msg.data.onlineType == '1'){
					gpsInfoCfgGrid.updateCell('onlineTypeNm', '在线', e.record);
				}else if(msg.data.onlineType == '2'){
					gpsInfoCfgGrid.updateCell('onlineTypeNm', '休眠', e.record);
				}
				gpsInfoCfgGrid.updateCell('gpsAddrInfo', msg.data.gpsAddrInfo, e.record);
				gpsInfoCfgGrid.updateCell('lng', msg.data.lng, e.record);
				gpsInfoCfgGrid.updateCell('lat', msg.data.lat, e.record);
				gpsInfoCfgGrid.updateCell('lastTm', msg.data.lastTm, e.record);
				gpsInfoCfgGrid.updateCell('fromLastTm', msg.data.fromLastTm, e.record);
			}
		}
	});
}



function  uploadCallbackForMore(fileData){
	var sysCd="${sysCd}";
	 var orgCd="${orgCd}";
	 var cfgCd="${cfgCd}";
	 var cfgDtlCd="${cfgDtlCd}";
	 var fileList = new Array();
	 var params = {};
	 for(var i = 0; i < fileData.length;i++){
   	  var obj = {};
   	      obj.fileNm=fileData[i].fileNm;
     	  obj.filePath=fileData[i].filePath;
     	  obj.pkId = dtlId;
		  obj.sysCd= sysCd;
		  obj.orgCd= orgCd;
		  obj.cfgCd =cfgCd;
		  obj.cfgDtlCd =cfgDtlCd;
		  fileList.push(obj);
     }
	 params.sysCd= sysCd;
	 params.orgCd= orgCd;
	 params.cfgCd =cfgCd;
	 params.cfgDtlCd =cfgDtlCd;
	 params["fileList"] = JSON.stringify(fileList);
    var url = '<%=path%>/project/prjprdvehinfo/addProjectPhoto.do';
    $.ajax({
		type: 'post',
		dataType:'json',
		data:params,
		url: url,
		success:function(msg){
			 if(msg.success == 1){
				 //top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
				 prjPrdVehImgList();
			 }else{
				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
			 }
		}
	});
} 




function prjDetailBtn(id){
	var fromPrjFlag = true;
	var detailFlag = true;
	var _flag = $("#fromPrjFlagId").val();
	if(StringUtils.isNotEmpty(_flag)){
		if(_flag == 'false'){
			fromPrjFlag = false;
		}
	}
	Add_navTab('tab_project_detail'+id,'项目详情','<%=path%>/project/prjbscinfo/toModifyPage.do?fromPrjFlag='+fromPrjFlag+'&&id='+id+'&&detailFlag='+detailFlag);
}

function prjPrdVehImgList(){
	var dtlId = '${dtlId}';
	var params = {};
	params.dtlId = dtlId;
    var url = '<%=path%>/project/prjprdvehinfo/getPrjPrdVehImgList.do';
    $.ajax({
		type: 'post',
		dataType:'json',
		data:params,
		url: url,
		success:function(msg){
			 if(msg.success == 1){
				 if(msg.data&&msg.data.length>0){
					 initImgData(msg.data);
				 }
			 }
		}
	});
}

function initImgData(data){
	 if(data&&data.length>0){
		var html = "";
	      html+="<tr>";
	      for(var i=0;i<data.length;i++){
	    	  var file = data[i];
	    	  if((i+1)%4==0){
	    		  html+="</tr>";
	    		  html+="<tr>";
	    	  }
	    	  html+="<td>";
              html+="<div class='imgBox'>";
              html+="<img id='imgPath' src='"+file.filePath+"' onclick='scanData(this,event);' href='"+file.filePath+"'>";
              html+="</div>";
              html+="</td>";
	      }
	      html+="</tr>";
	     $("#imgTable").html(html); 
	}
}

function payDetailBtn(prjPrdDtlId,id,prjPrdId,prjId){
	if(null==id){
		id = "";
	}
	if(null==prjPrdDtlId){
		prjPrdDtlId = "";
	}
	if(null==prjPrdId){
		prjPrdId = "";
	}
	var editFlag = true;
	Add_navTab('tab_prj_quat_prps'+id,'查看支付表','<%=path%>/project/prjprdpayschm/toAddPage.do?prjId='+prjId+'&&id='+id+'&&prjPrdDtlId='+prjPrdDtlId+'&&prjPrdId='+prjPrdId+'&&detailFlag='+editFlag);
}
//设置日期值
function setFormatDateValue(){
	var certDt ='${vehInfo.certDt}';
	if(certDt){
    	var certDate = DateUtils.formatDate(new Date(certDt),DateUtils.YYYY_MM_DD);
    	$("#certDt").val(certDate);//
    	$("#certDtTxt").text(certDate);
    	}
	
	var proDt ='${vehInfo.proDt}';
	if(proDt){
    	var proDate= DateUtils.formatDate(new Date(proDt),DateUtils.YYYY_MM_DD);
    	$("#proDt").val(proDate);//
    	}
	
}
	
  function scanData(img,event){
	            event.preventDefault();
	            var href = $(img).attr('src'); 
	           // var href = "http://10.10.36.18/attachments/CCI20170301_0004.JPG";
	            if (SQ.regs.img.test(href)) {
	                var scan = SQ.scanCode({
	                    href: href,
	                    onScan: function (value) {
	                        scan.close();
	                      /*   var wait_dialog=$.ligerDialog.SQalert({
	                            content: '二维码解析中...',
	                            SQ_type: "waitting"
	                        }); */
	                        var data = {};
	                        data.baseStr = value;
	                        var url = '<%=path%>/project/prjprdvehinfo/getPrjPrdVehInfo.do';
	                        $.ajax({
	                    		type: 'post',
	                    		dataType:'json',
	                    		data:data,
	                    		url: url,
	                    		success:function(msg){
	                    			 if(msg.success == 1){
	                    				 var veh = msg.data;
	                    				    var ligerForm = liger.get("prj_prd_veh_info_form");
	                    				 ligerForm.setData({
	                    					 chsMdl: veh.chsMdl,
	                    					 certNo: veh.certNo,
	                    					 mfrNm: veh.mfrNm,
	                    					 vehNm: veh.vehNm,
	                    					 vehBr: veh.vehBr,
	                    					 vin: veh.vin,
	                    					 engNo: veh.engNo,
	                    					 engMdl: veh.engMdl,
	                    					 emiStd: veh.emiStd,
	                    					 outVol: veh.outVol,
	                    					 maxKw: veh.maxKw,
	                    					 ratedWgt: veh.ratedWgt,
	                    					 ratedSeatQty: veh.ratedSeatQty,
	                    					 proDt: veh.proDt,
	                    					 carCl: veh.carCl,
	                    					 fuelTyp: veh.fuelTyp,
	                    					 traTotWgt: veh.traTotWgt,
	                    					 curbWgt: veh.curbWgt,
	                    					 prdMdl:veh.prdMdl,
	                    				 });
	                    				 
	                    			 }else{
	                    				 top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
	                    			 }
	                    		}
	                    	});

	                    }
	                });
	            }else{
	                alert('不是图片');
	            };
  }
	
	function save(){
		wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
        var GPSstr = gpsInfoCfgGrid.getData();
        var gpsNo = "";
        if (typeof GPSstr != "undefined" && null != GPSstr && "" != GPSstr){
            for (var i = 0; i < GPSstr.length; i++){
                if (GPSstr[i]['gpsCardNo'] == null || GPSstr[i]['gpsCardNo'] == '') {
                    gpsNums += "0" +","// 如果GPS卡号没有填写，默认0
                } else {
                    gpsNums += GPSstr[i]['gpsCardNo'] +","
                }
            }
        }
//        var gpsArray = gpsNo.split(",");
//        if(gpsNo == "" || (gpsArray[0]=='' || gpsArray[1] == '')){
//            $("#gpsInfoCfgGrid_comment").text("根据集团政策要求，必须维护两个GPS卡号信息，如果您所属部门政策仅要求维护一个GPS卡号信息，请按照顺序填写，第二个卡号填写“0”即可！");
//            $("#gpsInfoCfgGrid_comment").css("color","red");
//            return false;
//        }


        if(isGpsNode == 1){// 修改GPS，无需走GPS变更流程
			modifyGPS();
		}else if (isGpsNode == 0){// 需走GPS变更流程
			var GPSstr = gpsInfoCfgGrid.getData();
	        var data = {};
	        <%--var url = '<%=path%>/project/prjprdvehinfo/add.do';--%>
	        var url = '<%=path%>/project/prjprdvehinfo/addStartFlow.do';
	        var gpsNums = "";
	        if (typeof GPSstr != "undefined" && null != GPSstr){
	            for (var i = 0; i < GPSstr.length; i++){
	            	if(GPSstr[i]['serialNo'] == "1"){
	            		data.gps1 = GPSstr[i]['gpsCardNo'];
	            	}
					if(GPSstr[i]['serialNo'] == "2"){
						data.gps2 = GPSstr[i]['gpsCardNo'];
	            	}
                    if(GPSstr[i]['serialNo'] == "3"){
                        data.gps3 = GPSstr[i]['gpsCardNo'];
                    }
	               
				}
			}
	        
	        data.dtlId = dtlId;
	        data.prjId = '${prjId}';
			//data["gpsNums"] = gpsNums;

			// 校验接口
			$.ajax({
				type: 'post',
				dataType:'json',
				data:data,
				url: '<%=path%>/project/prjprdvehinfo/validateGps.do',
				success:function(msg){
					wait_dialog.close();
					if(msg.success == 1){
						if (msg.info != '' && msg.info != null) {
							// 说明要弹出确认框
							$.ligerDialog.confirm(msg.info, function (flag) {
								/* 点击是，做保存
                                *  点击否，不做保存
                                * */
								if(!flag) {
									return;
								}
								addStartFlow(data,url);
							});
						} else {
							addStartFlow(data,url);
						}
					}else{
						UIUtils.alertErrorHold1(msg.info);
					}
				}
			});
		}
	}

/**
 * 发起流程的保存gps信息
 * @param data
 * @param url
 */
function addStartFlow(data,url) {
	$.ajax({
		type: 'post',
		dataType:'json',
		data:data,
		url: url,
		/*beforeSend: function(){
            wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
       },*/
		success:function(msg){
			wait_dialog.close();
			if(msg.success == 1){
				$("#vehId").val(msg.data);
				top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
				var TAB=top.mainApp.parentTab;
				var currentTabid=TAB.getSelectedTabItemID();
				var currFrameElement=top.$("#"+currentTabid).get(0);
				var callback=currFrameElement.W2W.callback;
				callback();
				top.tab.removeTabItem(currentTabid);
			}else{
				top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
			}
		},
		error:function(msg){
			wait_dialog.close();
		}
	});
}


	function modifyGPS(){
        var GPSstr = gpsInfoCfgGrid.getData();
        var gpsNums = "";
        if (typeof GPSstr != "undefined" && null != GPSstr){
            for (var i = 0; i < GPSstr.length; i++){
                gpsNums += GPSstr[i]['gpsCardNo'] +","+GPSstr[i]['id']+";"
            }
        }
        console.log("gps卡号："+gpsNums);
		var data = {"gpsNums":gpsNums,"dtlId":dtlId};

		var dataValidate = {};
		if (typeof GPSstr != "undefined" && null != GPSstr){
			for (var i = 0; i < GPSstr.length; i++){
				if(GPSstr[i]['serialNo'] == "1"){
					dataValidate.gps1 = GPSstr[i]['gpsCardNo'];
				}
				if(GPSstr[i]['serialNo'] == "2"){
					dataValidate.gps2 = GPSstr[i]['gpsCardNo'];
				}
				if(GPSstr[i]['serialNo'] == "3"){
					dataValidate.gps3 = GPSstr[i]['gpsCardNo'];
				}
			}
		}

		dataValidate.dtlId = dtlId;
		// 校验接口
		$.ajax({
			type: 'post',
			dataType:'json',
			data:dataValidate,
			url: '<%=path%>/project/prjprdvehinfo/validateGps.do',
			success:function(msg){
				if(msg.success == 1){
					if (msg.info != '' && msg.info != null) {
						// 说明要弹出确认框
						$.ligerDialog.confirm(msg.info, function (flag) {
							wait_dialog.close();
							/* 点击是，做保存
                            *  点击否，不做保存
                            * */
							if(!flag) {
								return;
							}
							modiyGps(data);
						});
					} else {
						modiyGps(data);
					}
				}else{
					wait_dialog.close();
					top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
				}
			}
		});
	}

	function modiyGps(data) {
		/*var wait_dialog;*/
		$.ajax({
			type: 'post',
			dataType:'json',
			data:data,
			url: '<%=path%>/prjprddtlgps/prjPrdDtlGps/modifyGPS.do',
			/*beforeSend: function(){
                wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
            },*/
            success:function(msg){
                wait_dialog.close();
                if(msg.success == 1){
                    $("#vehId").val(msg.data);
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
                    var TAB=top.mainApp.parentTab;
                    var currentTabid=TAB.getSelectedTabItemID();
                    var currFrameElement=top.$("#"+currentTabid).get(0);
                    var callback=currFrameElement.W2W.callback;
                 /*    callback();
                    top.tab.removeTabItem(currentTabid); */
                }else{
                    top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
                }
            },
			error:function(msg){
				wait_dialog.close();
			}
        });
	}


</script>
</body>
</html>